Optimal. Leaf size=224 \[ \frac {5 e+8 g-(2 e+5 g) x^2}{36 \left (4-5 x^2+x^4\right )^2}+\frac {x \left (17 d+20 f+32 h-(5 d+8 f+20 h) x^2\right )}{144 \left (4-5 x^2+x^4\right )^2}-\frac {(2 e+5 g) \left (5-2 x^2\right )}{108 \left (4-5 x^2+x^4\right )}-\frac {x \left (59 d+380 f+848 h-5 (7 d+28 f+64 h) x^2\right )}{3456 \left (4-5 x^2+x^4\right )}-\frac {(313 d+820 f+1936 h) \tanh ^{-1}\left (\frac {x}{2}\right )}{20736}+\frac {1}{648} (13 d+25 f+61 h) \tanh ^{-1}(x)-\frac {1}{162} (2 e+5 g) \log \left (1-x^2\right )+\frac {1}{162} (2 e+5 g) \log \left (4-x^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.20, antiderivative size = 224, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 10, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.303, Rules used = {1687, 1692,
1192, 1180, 213, 1261, 652, 628, 630, 31} \begin {gather*} -\frac {x \left (-5 x^2 (7 d+28 f+64 h)+59 d+380 f+848 h\right )}{3456 \left (x^4-5 x^2+4\right )}+\frac {x \left (-\left (x^2 (5 d+8 f+20 h)\right )+17 d+20 f+32 h\right )}{144 \left (x^4-5 x^2+4\right )^2}-\frac {\tanh ^{-1}\left (\frac {x}{2}\right ) (313 d+820 f+1936 h)}{20736}+\frac {1}{648} \tanh ^{-1}(x) (13 d+25 f+61 h)-\frac {1}{162} (2 e+5 g) \log \left (1-x^2\right )+\frac {1}{162} (2 e+5 g) \log \left (4-x^2\right )-\frac {\left (5-2 x^2\right ) (2 e+5 g)}{108 \left (x^4-5 x^2+4\right )}+\frac {-\left (x^2 (2 e+5 g)\right )+5 e+8 g}{36 \left (x^4-5 x^2+4\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 213
Rule 628
Rule 630
Rule 652
Rule 1180
Rule 1192
Rule 1261
Rule 1687
Rule 1692
Rubi steps
\begin {align*} \int \frac {d+e x+f x^2+g x^3+h x^4}{\left (4-5 x^2+x^4\right )^3} \, dx &=\int \frac {x \left (e+g x^2\right )}{\left (4-5 x^2+x^4\right )^3} \, dx+\int \frac {d+f x^2+h x^4}{\left (4-5 x^2+x^4\right )^3} \, dx\\ &=\frac {x \left (17 d+20 f+32 h-(5 d+8 f+20 h) x^2\right )}{144 \left (4-5 x^2+x^4\right )^2}-\frac {1}{144} \int \frac {-19 d+20 f+32 h+5 (5 d+8 f+20 h) x^2}{\left (4-5 x^2+x^4\right )^2} \, dx+\frac {1}{2} \text {Subst}\left (\int \frac {e+g x}{\left (4-5 x+x^2\right )^3} \, dx,x,x^2\right )\\ &=\frac {5 e+8 g-(2 e+5 g) x^2}{36 \left (4-5 x^2+x^4\right )^2}+\frac {x \left (17 d+20 f+32 h-(5 d+8 f+20 h) x^2\right )}{144 \left (4-5 x^2+x^4\right )^2}-\frac {x \left (59 d+380 f+848 h-5 (7 d+28 f+64 h) x^2\right )}{3456 \left (4-5 x^2+x^4\right )}+\frac {\int \frac {3 (173 d+260 f+656 h)+15 (7 d+28 f+64 h) x^2}{4-5 x^2+x^4} \, dx}{10368}+\frac {1}{12} (-2 e-5 g) \text {Subst}\left (\int \frac {1}{\left (4-5 x+x^2\right )^2} \, dx,x,x^2\right )\\ &=\frac {5 e+8 g-(2 e+5 g) x^2}{36 \left (4-5 x^2+x^4\right )^2}+\frac {x \left (17 d+20 f+32 h-(5 d+8 f+20 h) x^2\right )}{144 \left (4-5 x^2+x^4\right )^2}-\frac {(2 e+5 g) \left (5-2 x^2\right )}{108 \left (4-5 x^2+x^4\right )}-\frac {x \left (59 d+380 f+848 h-5 (7 d+28 f+64 h) x^2\right )}{3456 \left (4-5 x^2+x^4\right )}+\frac {1}{54} (2 e+5 g) \text {Subst}\left (\int \frac {1}{4-5 x+x^2} \, dx,x,x^2\right )+\frac {1}{648} (-13 d-25 f-61 h) \int \frac {1}{-1+x^2} \, dx+\frac {(313 d+820 f+1936 h) \int \frac {1}{-4+x^2} \, dx}{10368}\\ &=\frac {5 e+8 g-(2 e+5 g) x^2}{36 \left (4-5 x^2+x^4\right )^2}+\frac {x \left (17 d+20 f+32 h-(5 d+8 f+20 h) x^2\right )}{144 \left (4-5 x^2+x^4\right )^2}-\frac {(2 e+5 g) \left (5-2 x^2\right )}{108 \left (4-5 x^2+x^4\right )}-\frac {x \left (59 d+380 f+848 h-5 (7 d+28 f+64 h) x^2\right )}{3456 \left (4-5 x^2+x^4\right )}-\frac {(313 d+820 f+1936 h) \tanh ^{-1}\left (\frac {x}{2}\right )}{20736}+\frac {1}{648} (13 d+25 f+61 h) \tanh ^{-1}(x)+\frac {1}{162} (-2 e-5 g) \text {Subst}\left (\int \frac {1}{-1+x} \, dx,x,x^2\right )+\frac {1}{162} (2 e+5 g) \text {Subst}\left (\int \frac {1}{-4+x} \, dx,x,x^2\right )\\ &=\frac {5 e+8 g-(2 e+5 g) x^2}{36 \left (4-5 x^2+x^4\right )^2}+\frac {x \left (17 d+20 f+32 h-(5 d+8 f+20 h) x^2\right )}{144 \left (4-5 x^2+x^4\right )^2}-\frac {(2 e+5 g) \left (5-2 x^2\right )}{108 \left (4-5 x^2+x^4\right )}-\frac {x \left (59 d+380 f+848 h-5 (7 d+28 f+64 h) x^2\right )}{3456 \left (4-5 x^2+x^4\right )}-\frac {(313 d+820 f+1936 h) \tanh ^{-1}\left (\frac {x}{2}\right )}{20736}+\frac {1}{648} (13 d+25 f+61 h) \tanh ^{-1}(x)-\frac {1}{162} (2 e+5 g) \log \left (1-x^2\right )+\frac {1}{162} (2 e+5 g) \log \left (4-x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 231, normalized size = 1.03 \begin {gather*} \frac {20 e+32 g+17 d x+20 f x+32 h x-8 e x^2-20 g x^2-5 d x^3-8 f x^3-20 h x^3}{144 \left (4-5 x^2+x^4\right )^2}+\frac {-320 e-800 g-59 d x-380 f x-848 h x+128 e x^2+320 g x^2+35 d x^3+140 f x^3+320 h x^3}{3456 \left (4-5 x^2+x^4\right )}+\frac {(-13 d-16 e-25 f-40 g-61 h) \log (1-x)}{1296}+\frac {(313 d+512 e+820 f+1280 g+1936 h) \log (2-x)}{41472}+\frac {(13 d-16 e+25 f-40 g+61 h) \log (1+x)}{1296}+\frac {(-313 d+512 e-820 f+1280 g-1936 h) \log (2+x)}{41472} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 270, normalized size = 1.21
method | result | size |
norman | \(\frac {\left (-\frac {13 d}{192}-\frac {5 f}{16}-\frac {17 h}{24}\right ) x^{5}+\left (\frac {35 d}{384}+\frac {21 f}{32}+\frac {35 h}{24}\right ) x^{3}+\left (\frac {35 d}{3456}+\frac {35 f}{864}+\frac {5 h}{54}\right ) x^{7}+\left (\frac {43 d}{864}-\frac {65 f}{216}-\frac {41 h}{54}\right ) x +\left (\frac {5 e}{9}+\frac {25 g}{18}\right ) x^{2}+\left (\frac {e}{27}+\frac {5 g}{54}\right ) x^{6}+\left (-\frac {5 e}{18}-\frac {25 g}{36}\right ) x^{4}-\frac {25 e}{108}-\frac {19 g}{27}}{\left (x^{4}-5 x^{2}+4\right )^{2}}+\left (-\frac {313 d}{41472}+\frac {e}{81}-\frac {205 f}{10368}+\frac {5 g}{162}-\frac {121 h}{2592}\right ) \ln \left (x +2\right )+\left (-\frac {13 d}{1296}-\frac {e}{81}-\frac {25 f}{1296}-\frac {5 g}{162}-\frac {61 h}{1296}\right ) \ln \left (-1+x \right )+\left (\frac {13 d}{1296}-\frac {e}{81}+\frac {25 f}{1296}-\frac {5 g}{162}+\frac {61 h}{1296}\right ) \ln \left (1+x \right )+\left (\frac {313 d}{41472}+\frac {e}{81}+\frac {205 f}{10368}+\frac {5 g}{162}+\frac {121 h}{2592}\right ) \ln \left (x -2\right )\) | \(193\) |
risch | \(\frac {\left (-\frac {13 d}{192}-\frac {5 f}{16}-\frac {17 h}{24}\right ) x^{5}+\left (\frac {35 d}{384}+\frac {21 f}{32}+\frac {35 h}{24}\right ) x^{3}+\left (\frac {35 d}{3456}+\frac {35 f}{864}+\frac {5 h}{54}\right ) x^{7}+\left (\frac {43 d}{864}-\frac {65 f}{216}-\frac {41 h}{54}\right ) x +\left (\frac {5 e}{9}+\frac {25 g}{18}\right ) x^{2}+\left (\frac {e}{27}+\frac {5 g}{54}\right ) x^{6}+\left (-\frac {5 e}{18}-\frac {25 g}{36}\right ) x^{4}-\frac {25 e}{108}-\frac {19 g}{27}}{\left (x^{4}-5 x^{2}+4\right )^{2}}-\frac {313 \ln \left (x +2\right ) d}{41472}+\frac {\ln \left (x +2\right ) e}{81}-\frac {205 \ln \left (x +2\right ) f}{10368}+\frac {5 \ln \left (x +2\right ) g}{162}-\frac {121 \ln \left (x +2\right ) h}{2592}+\frac {313 \ln \left (2-x \right ) d}{41472}+\frac {\ln \left (2-x \right ) e}{81}+\frac {205 \ln \left (2-x \right ) f}{10368}+\frac {5 \ln \left (2-x \right ) g}{162}+\frac {121 \ln \left (2-x \right ) h}{2592}+\frac {13 \ln \left (1+x \right ) d}{1296}-\frac {\ln \left (1+x \right ) e}{81}+\frac {25 \ln \left (1+x \right ) f}{1296}-\frac {5 \ln \left (1+x \right ) g}{162}+\frac {61 \ln \left (1+x \right ) h}{1296}-\frac {13 \ln \left (1-x \right ) d}{1296}-\frac {\ln \left (1-x \right ) e}{81}-\frac {25 \ln \left (1-x \right ) f}{1296}-\frac {5 \ln \left (1-x \right ) g}{162}-\frac {61 \ln \left (1-x \right ) h}{1296}\) | \(269\) |
default | \(\left (-\frac {313 d}{41472}+\frac {e}{81}-\frac {205 f}{10368}+\frac {5 g}{162}-\frac {121 h}{2592}\right ) \ln \left (x +2\right )-\frac {-\frac {19 d}{6912}+\frac {17 e}{3456}-\frac {5 f}{576}+\frac {13 g}{864}-\frac {11 h}{432}}{x +2}-\frac {-\frac {d}{1728}+\frac {e}{864}-\frac {f}{432}+\frac {g}{216}-\frac {h}{108}}{2 \left (x +2\right )^{2}}-\frac {-\frac {19 d}{6912}-\frac {17 e}{3456}-\frac {5 f}{576}-\frac {13 g}{864}-\frac {11 h}{432}}{x -2}-\frac {\frac {d}{1728}+\frac {e}{864}+\frac {f}{432}+\frac {g}{216}+\frac {h}{108}}{2 \left (x -2\right )^{2}}+\left (\frac {313 d}{41472}+\frac {e}{81}+\frac {205 f}{10368}+\frac {5 g}{162}+\frac {121 h}{2592}\right ) \ln \left (x -2\right )+\left (-\frac {13 d}{1296}-\frac {e}{81}-\frac {25 f}{1296}-\frac {5 g}{162}-\frac {61 h}{1296}\right ) \ln \left (-1+x \right )-\frac {-\frac {d}{432}-\frac {e}{144}-\frac {5 f}{432}-\frac {7 g}{432}-\frac {h}{48}}{-1+x}-\frac {-\frac {d}{216}-\frac {e}{216}-\frac {f}{216}-\frac {g}{216}-\frac {h}{216}}{2 \left (-1+x \right )^{2}}-\frac {-\frac {d}{432}+\frac {e}{144}-\frac {5 f}{432}+\frac {7 g}{432}-\frac {h}{48}}{1+x}-\frac {\frac {d}{216}-\frac {e}{216}+\frac {f}{216}-\frac {g}{216}+\frac {h}{216}}{2 \left (1+x \right )^{2}}+\left (\frac {13 d}{1296}-\frac {e}{81}+\frac {25 f}{1296}-\frac {5 g}{162}+\frac {61 h}{1296}\right ) \ln \left (1+x \right )\) | \(270\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 222, normalized size = 0.99 \begin {gather*} -\frac {1}{41472} \, {\left (313 \, d + 820 \, f - 1280 \, g + 1936 \, h - 512 \, e\right )} \log \left (x + 2\right ) + \frac {1}{1296} \, {\left (13 \, d + 25 \, f - 40 \, g + 61 \, h - 16 \, e\right )} \log \left (x + 1\right ) - \frac {1}{1296} \, {\left (13 \, d + 25 \, f + 40 \, g + 61 \, h + 16 \, e\right )} \log \left (x - 1\right ) + \frac {1}{41472} \, {\left (313 \, d + 820 \, f + 1280 \, g + 1936 \, h + 512 \, e\right )} \log \left (x - 2\right ) + \frac {5 \, {\left (7 \, d + 28 \, f + 64 \, h\right )} x^{7} + 64 \, {\left (5 \, g + 2 \, e\right )} x^{6} - 18 \, {\left (13 \, d + 60 \, f + 136 \, h\right )} x^{5} - 480 \, {\left (5 \, g + 2 \, e\right )} x^{4} + 63 \, {\left (5 \, d + 36 \, f + 80 \, h\right )} x^{3} + 960 \, {\left (5 \, g + 2 \, e\right )} x^{2} + 4 \, {\left (43 \, d - 260 \, f - 656 \, h\right )} x - 2432 \, g - 800 \, e}{3456 \, {\left (x^{8} - 10 \, x^{6} + 33 \, x^{4} - 40 \, x^{2} + 16\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 544 vs.
\(2 (204) = 408\).
time = 1.66, size = 544, normalized size = 2.43 \begin {gather*} \frac {60 \, {\left (7 \, d + 28 \, f + 64 \, h\right )} x^{7} + 768 \, {\left (2 \, e + 5 \, g\right )} x^{6} - 216 \, {\left (13 \, d + 60 \, f + 136 \, h\right )} x^{5} - 5760 \, {\left (2 \, e + 5 \, g\right )} x^{4} + 756 \, {\left (5 \, d + 36 \, f + 80 \, h\right )} x^{3} + 11520 \, {\left (2 \, e + 5 \, g\right )} x^{2} + 48 \, {\left (43 \, d - 260 \, f - 656 \, h\right )} x - {\left ({\left (313 \, d - 512 \, e + 820 \, f - 1280 \, g + 1936 \, h\right )} x^{8} - 10 \, {\left (313 \, d - 512 \, e + 820 \, f - 1280 \, g + 1936 \, h\right )} x^{6} + 33 \, {\left (313 \, d - 512 \, e + 820 \, f - 1280 \, g + 1936 \, h\right )} x^{4} - 40 \, {\left (313 \, d - 512 \, e + 820 \, f - 1280 \, g + 1936 \, h\right )} x^{2} + 5008 \, d - 8192 \, e + 13120 \, f - 20480 \, g + 30976 \, h\right )} \log \left (x + 2\right ) + 32 \, {\left ({\left (13 \, d - 16 \, e + 25 \, f - 40 \, g + 61 \, h\right )} x^{8} - 10 \, {\left (13 \, d - 16 \, e + 25 \, f - 40 \, g + 61 \, h\right )} x^{6} + 33 \, {\left (13 \, d - 16 \, e + 25 \, f - 40 \, g + 61 \, h\right )} x^{4} - 40 \, {\left (13 \, d - 16 \, e + 25 \, f - 40 \, g + 61 \, h\right )} x^{2} + 208 \, d - 256 \, e + 400 \, f - 640 \, g + 976 \, h\right )} \log \left (x + 1\right ) - 32 \, {\left ({\left (13 \, d + 16 \, e + 25 \, f + 40 \, g + 61 \, h\right )} x^{8} - 10 \, {\left (13 \, d + 16 \, e + 25 \, f + 40 \, g + 61 \, h\right )} x^{6} + 33 \, {\left (13 \, d + 16 \, e + 25 \, f + 40 \, g + 61 \, h\right )} x^{4} - 40 \, {\left (13 \, d + 16 \, e + 25 \, f + 40 \, g + 61 \, h\right )} x^{2} + 208 \, d + 256 \, e + 400 \, f + 640 \, g + 976 \, h\right )} \log \left (x - 1\right ) + {\left ({\left (313 \, d + 512 \, e + 820 \, f + 1280 \, g + 1936 \, h\right )} x^{8} - 10 \, {\left (313 \, d + 512 \, e + 820 \, f + 1280 \, g + 1936 \, h\right )} x^{6} + 33 \, {\left (313 \, d + 512 \, e + 820 \, f + 1280 \, g + 1936 \, h\right )} x^{4} - 40 \, {\left (313 \, d + 512 \, e + 820 \, f + 1280 \, g + 1936 \, h\right )} x^{2} + 5008 \, d + 8192 \, e + 13120 \, f + 20480 \, g + 30976 \, h\right )} \log \left (x - 2\right ) - 9600 \, e - 29184 \, g}{41472 \, {\left (x^{8} - 10 \, x^{6} + 33 \, x^{4} - 40 \, x^{2} + 16\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 4.23, size = 224, normalized size = 1.00 \begin {gather*} -\frac {1}{41472} \, {\left (313 \, d + 820 \, f - 1280 \, g + 1936 \, h - 512 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) + \frac {1}{1296} \, {\left (13 \, d + 25 \, f - 40 \, g + 61 \, h - 16 \, e\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{1296} \, {\left (13 \, d + 25 \, f + 40 \, g + 61 \, h + 16 \, e\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac {1}{41472} \, {\left (313 \, d + 820 \, f + 1280 \, g + 1936 \, h + 512 \, e\right )} \log \left ({\left | x - 2 \right |}\right ) + \frac {35 \, d x^{7} + 140 \, f x^{7} + 320 \, h x^{7} + 320 \, g x^{6} + 128 \, x^{6} e - 234 \, d x^{5} - 1080 \, f x^{5} - 2448 \, h x^{5} - 2400 \, g x^{4} - 960 \, x^{4} e + 315 \, d x^{3} + 2268 \, f x^{3} + 5040 \, h x^{3} + 4800 \, g x^{2} + 1920 \, x^{2} e + 172 \, d x - 1040 \, f x - 2624 \, h x - 2432 \, g - 800 \, e}{3456 \, {\left (x^{4} - 5 \, x^{2} + 4\right )}^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.25, size = 209, normalized size = 0.93 \begin {gather*} \ln \left (x+1\right )\,\left (\frac {13\,d}{1296}-\frac {e}{81}+\frac {25\,f}{1296}-\frac {5\,g}{162}+\frac {61\,h}{1296}\right )-\ln \left (x-1\right )\,\left (\frac {13\,d}{1296}+\frac {e}{81}+\frac {25\,f}{1296}+\frac {5\,g}{162}+\frac {61\,h}{1296}\right )-\frac {\left (-\frac {35\,d}{3456}-\frac {35\,f}{864}-\frac {5\,h}{54}\right )\,x^7+\left (-\frac {e}{27}-\frac {5\,g}{54}\right )\,x^6+\left (\frac {13\,d}{192}+\frac {5\,f}{16}+\frac {17\,h}{24}\right )\,x^5+\left (\frac {5\,e}{18}+\frac {25\,g}{36}\right )\,x^4+\left (-\frac {35\,d}{384}-\frac {21\,f}{32}-\frac {35\,h}{24}\right )\,x^3+\left (-\frac {5\,e}{9}-\frac {25\,g}{18}\right )\,x^2+\left (\frac {65\,f}{216}-\frac {43\,d}{864}+\frac {41\,h}{54}\right )\,x+\frac {25\,e}{108}+\frac {19\,g}{27}}{x^8-10\,x^6+33\,x^4-40\,x^2+16}+\ln \left (x-2\right )\,\left (\frac {313\,d}{41472}+\frac {e}{81}+\frac {205\,f}{10368}+\frac {5\,g}{162}+\frac {121\,h}{2592}\right )-\ln \left (x+2\right )\,\left (\frac {313\,d}{41472}-\frac {e}{81}+\frac {205\,f}{10368}-\frac {5\,g}{162}+\frac {121\,h}{2592}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________